﻿@model IEnumerable<Urna_TP.Models.Candidato>

@{
    ViewBag.Title = "Index";
}

<h2>Candidatos</h2>

<button>
    @Html.ActionLink("Crea uno nuevo", "Create")
</button>
<table class="table table-striped">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Nombre)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Apellido)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Foto)
        </th>
        <th>
            Cantidad de Votos
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Nombre)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Apellido)
            </td>
            <td>
                <img src="@Html.DisplayFor(modelItem => item.Foto)" height="100" width="100" />
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CantVotos)
            </td>
            <td>
                <button class="zero">
                    @Html.ActionLink("Editar", "Edit", new { id = item.ID }) |
                    @Html.ActionLink("Detalles", "Details", new { id = item.ID }) |
                    @Html.ActionLink("Eliminar", "Delete", new { id = item.ID })
                </button>
            </td>
        </tr>
    }

</table>
